# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=go-nats
pkgver=1.5.0
pkgrel=1
pkgdesc="Golang client for NATS, the cloud native messaging system"
url="https://github.com/nats-io/go-nats"
arch="noarch"
license="MIT"
depends="go"
subpackages="$pkgname-doc"
_vendor="nats-io"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/$_vendor/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	return 0
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/usr/share/doc/$_vendor/$pkgname \
		"$pkgdir"/usr/lib/go/src/github.com/$_vendor/$pkgname
	# some programs look for "nats" library
	ln -s go-nats "$pkgdir"/usr/lib/go/src/github.com/$_vendor/nats
	for file in \
		LICENSE \
		README.* \
		COPYRIGHT \
		AUTHORS \
		TODO.* \
		; do \
		test -e $file && mv $file "$pkgdir"/usr/share/doc/$_vendor/$pkgname
	done
	mv * "$pkgdir"/usr/lib/go/src/github.com/$_vendor/$pkgname
}

sha512sums="e7af1fa4c337cb578583c1c920ebfb9df60be0abe1aa99a0932792a509ee7b0ea1a02bef4bd5d4307c6259b1f73420d289d2a67966e69d3427e049139c862b09  go-nats-1.5.0.tar.gz"
